//
//  Elastic.m
//  Zaker
//
//  Created by lirui on 16/3/15.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Elastic.h"
#import "WXApi.h"
@implementation Elastic

+(void)elastic:(NSString *)string
{
    
    NSArray *Objs = @[
                      [MenuLabel CreatelabelIconName:@"wechat" Title:@"微信"],
                      [MenuLabel CreatelabelIconName:@"pengyouquan" Title:@"朋友圈"],
                      [MenuLabel CreatelabelIconName:@"qq" Title:@"QQ"],
                      [MenuLabel CreatelabelIconName:@"qqkongjian" Title:@"QQZone"],
                      [MenuLabel CreatelabelIconName:@"weibo" Title:@"微博"],
                      [MenuLabel CreatelabelIconName:nil Title:nil]
                      
                      ];
    
    [HyPopMenuView CreatingPopMenuObjectItmes:Objs TopView:nil OpenOrCloseAudioDictionary:nil SelectdCompletionBlock:^(MenuLabel *menuLabel, NSInteger index) {
        //        NSLog(@"index:%ld ItmeNmae:%@",index,menuLabel.title);
        Elastic *elastci = [[Elastic alloc] init];
        
        if (index == 0) {
            [elastci weixin:string];
            
        }else if (index == 1){
            [elastci penyouquan:string] ;
            
        }else if (index == 2){
//            [elastci QQliaotian];
            
        }else if (index == 3) {
            NSLog(@"qqkongjian");
//            [elastci QQkongjian];
        }else if (index == 4){
            
        }
    }];

}

- (void)weixin:(NSString *)str
{
    
    SendMessageToWXReq* req = [[SendMessageToWXReq alloc] init];
    req.text = str;
    req.bText = YES;
    req.scene = WXSceneSession;
    
    [WXApi sendReq:req];
}
- (void) penyouquan:(NSString *)str
{
//    WXMediaMessage *message = [WXMediaMessage message];
//    [message setThumbImage:[UIImage imageNamed:@"apple"]];
//
//    WXImageObject *ext = [WXImageObject object];
//
//    ext.imageUrl  = url;
    SendMessageToWXReq* req = [[SendMessageToWXReq alloc] init];
    req.text = str;
    req.bText = YES;
    req.scene = WXSceneTimeline;
    
    [WXApi sendReq:req];
}

@end
